tmem: fix freeable memory accounting error
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 24 Nov 2009 14:38:37 +0000 (14:38 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 24 Nov 2009 14:38:37 +0000 (14:38 +0000)
Fix tmem accounting error that causes an "apparent"
memory leak, creating false negatives when testing
memory availability for launching a new domain.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen/include/xen/tmem_xen.h

index 0e19c90680f079ddee7fff9aa1090377602c08aa..90b860a5f975defa0c08bb438fb5a95a1afe2117 100644 (file)
@@ -229,7 +229,7 @@ static inline struct page_info *tmh_alloc_page(void *pool, int no_heap)
     if ( pi == NULL && !no_heap )
         pi = alloc_domheap_pages(0,0,MEMF_tmem);
     ASSERT((pi == NULL) || IS_VALID_PAGE(pi));
-    if ( pi != NULL )
+    if ( pi != NULL && !no_heap )
         atomic_inc(&freeable_page_count);
     return pi;
 }